home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / audiofile / AFgetsampfmt.z / AFgetsampfmt
Encoding:
Text File  |  1998-10-20  |  10.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4. aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))                                  aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      afGetSampleFormat, AFgetsampfmt, afGetVirtualSampleFormat,
  10.      afGetByteOrder, afGetVirtualByteOrder - get the track / virtual sample
  11.      format or byte order for a specified audio track from an AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee
  12.      structure.
  13.  
  14. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////aaaauuuuddddiiiiooooffffiiiilllleeee....hhhh>>>>
  16.  
  17.      vvvvooooiiiidddd aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk,,,,
  18.                             iiiinnnntttt ****ssssaaaammmmppppffffmmmmtttt,,,, iiiinnnntttt ****ssssaaaammmmppppwwwwiiiiddddtttthhhh))))
  19.  
  20.      vvvvooooiiiidddd aaaaffffGGGGeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk,,,,
  21.                                    iiiinnnntttt ****ssssaaaammmmppppffffmmmmtttt,,,, iiiinnnntttt ****ssssaaaammmmppppwwwwiiiiddddtttthhhh))))
  22.  
  23.      iiiinnnntttt aaaaffffGGGGeeeettttBBBByyyytttteeeeOOOOrrrrddddeeeerrrr((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk))))
  24.  
  25.      iiiinnnntttt aaaaffffGGGGeeeettttVVVViiiirrrrttttuuuuaaaallllBBBByyyytttteeeeOOOOrrrrddddeeeerrrr((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk))))
  26.  
  27. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  28.      _f_i_l_e        expects an AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee structure, previously created when an
  29.                  audio file was opened by a call to aaaaffffOOOOppppeeeennnnFFFFiiiilllleeee(3dm) or
  30.                  aaaaffffOOOOppppeeeennnnFFFFDDDD(3dm).
  31.  
  32.      _t_r_a_c_k       expects an integer which identifies the audio track in the
  33.                  file.  Since all file formats currently supported by the
  34.                  audio file library allow at most one audio track per file,
  35.                  the value AAAAFFFF____DDDDEEEEFFFFAAAAUUUULLLLTTTT____TTTTRRRRAAAACCCCKKKK should always be used for this
  36.                  argument.
  37.  
  38.      _s_a_m_p_f_m_t     is a pointer to an integer location.  The routine uses this
  39.                  location to return a symbolic integer constant denoting the
  40.                  format of the sample data.
  41.  
  42.                  For AIFF-C (AIFF) files, this value is always
  43.                  AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____TTTTWWWWOOOOSSSSCCCCOOOOMMMMPPPP, linear two's complement PCM.  Other
  44.                  currently supported file types support AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____UUUUNNNNSSSSIIIIGGGGNNNNEEEEDDDD
  45.                  (unsigned), AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____FFFFLLLLOOOOAAAATTTT (32-bit floating point) or
  46.                  AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____DDDDOOOOUUUUBBBBLLLLEEEE (64-bit double-precision floating point)
  47.                  formats.
  48.  
  49.      _s_a_m_p_w_i_d_t_h   is a pointer to an integer location.  The routine returns a
  50.                  nonnegative integer value here which gives the sample width
  51.                  for the audio track in bits.
  52.  
  53.                  For AIFF-C (AIFF) files, this value is greater than 0 and
  54.                  less than or equal to 32.  This parameter may or may not be
  55.                  meaningful depending on the value of _s_a_m_p_f_m_t.  For
  56.                  AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____TTTTWWWWOOOOSSSSCCCCOOOOMMMMPPPP it is the number of bits per sample in
  57.                  the 2's complement signed integer.  See the _C_A_V_E_A_T_S section
  58.                  below for more details.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))                                  aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  75.      aaaaffffGGGGeeeettttBBBByyyytttteeeeOOOOrrrrddddeeeerrrr(((()))) and aaaaffffGGGGeeeettttVVVViiiirrrrttttuuuuaaaallllBBBByyyytttteeeeOOOOrrrrddddeeeerrrr(((()))) return an integer token
  76.      representing the byte order of the samples.  This value will be either
  77.      AAAAFFFF____BBBBYYYYTTTTEEEEOOOORRRRDDDDEEEERRRR____BBBBIIIIGGGGEEEENNNNDDDDIIIIAAAANNNN or AAAAFFFF____BBBBYYYYTTTTEEEEOOOORRRRDDDDEEEERRRR____LLLLIIIITTTTTTTTLLLLEEEEEEEENNNNDDDDIIIIAAAANNNN.
  78.  
  79. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  80.      aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt(((()))) and aaaaffffGGGGeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt(((()))) return the sample
  81.      format and sample width (in bits) for the audio file's _t_r_a_c_k and the
  82.      audio buffer, respectively, using the integer pointer arguments.  See
  83.      aaaaffffIIIInnnnttttrrrroooo(3dm) for an explanation of virtual format.
  84.  
  85.      An AIFF-C file which contains 16 bit sample data would return the value
  86.      AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____TTTTWWWWOOOOSSSSCCCCOOOOMMMMPPPP in the location _s_a_m_p_f_m_t, and the value 16 in the
  87.      location _s_a_m_p_w_i_d_t_h.
  88.  
  89.      You can use the sample width value to determine the data type used to
  90.      pass samples to aaaaffffWWWWrrrriiiitttteeeeFFFFrrrraaaammmmeeeessss(3dm), or to obtain samples from
  91.      aaaaffffRRRReeeeaaaaddddFFFFrrrraaaammmmeeeessss(3dm).
  92.  
  93.      1-8 bit samples are packed into signed cccchhhhaaaarrrrssss, 9-16 bit samples are packed
  94.      into sssshhhhoooorrrrttttssss, and 17-32 bit samples are packed into iiiinnnntttteeeeggggeeeerrrrssss or ffffllllooooaaaattttssss,
  95.      depending on the _s_a_m_p_f_m_t, and 64-bit samples are stored into ddddoooouuuubbbblllleeeessss.
  96.  
  97.      SGI has proposed an extension to the AIFF-C format which will allow files
  98.      to store linear PCM samples as scaled IEEE floats or doubles in addition
  99.      to two's complement integers.
  100.  
  101. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  102.      If aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt(((()))) returns the value 8 in _s_a_m_p_w_i_d_t_h, and
  103.      AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____UUUUNNNNSSSSIIIIGGGGNNNNEEEEDDDD in _s_a_m_p_f_m_t, allocate an uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr buffer for
  104.      reading samples from a file via aaaaffffRRRReeeeaaaaddddFFFFrrrraaaammmmeeeessss(3dm).
  105.  
  106.      If aaaaffffGGGGeeeettttSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt(((()))) returns the value 13 in _s_a_m_p_w_i_d_t_h and
  107.      AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____TTTTWWWWOOOOSSSSCCCCOOOOMMMMPPPP in _s_a_m_p_f_m_t, allocate a (signed) sssshhhhoooorrrrtttt buffer for
  108.      reading samples from the file.
  109.  
  110. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  111.      Note that this library will continue to support new file formats and thus
  112.      other data formats than the ones described above.  Since the Audio File
  113.      Library is a Dynamic Shared Object (DSO), it is possible for this call to
  114.      return a sampfmt value not found in <aaaauuuuddddiiiiooooffffiiiilllleeee....hhhh> at the time of
  115.      programming.  Programs should be written to at least reject files with
  116.      sample formats they are not written to handle.
  117.  
  118. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  119.      afOpenFile(3dm), afReadFrames(3dm), afWriteFrames(3dm),
  120.      afInitSampleFormat(3dm), afSetVirtualSampleFormat(3dm)
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.